																														
<!DOCTYPE html>
<html lang="zh-cn">
	<head>
	    <meta charset="utf-8">
	    <meta http-equiv="X-UA-Compatible" content="IE=edge">
	    <meta name="viewport" content="width=device-width, initial-scale=1">
	    <#include "/common/meta.ftl"/>
	    <#include "/common/form.ftl"/>
	    
	      <script>
	    	(function(){ 
			  $.fn.extend({ 
				checks_select: function(options){ 
					jq_checks_select = null; 
					$(this).click(function(e){ 
						jq_check = $(this); 
						jq_id = $("#checks_seelect_id");
						//jq_check.attr("class", ""); 
						if (jq_checks_select == null) { 
							jq_checks_select = $("<div class='checks_div_select'></div>").insertAfter(jq_check); 
							$.each(options, function(i, n){ 
								check_div=$("<div id='"+i+"check_div' ><div style='float:left;'>&nbsp;<input id='" + i + "'style='margin-top:5px' type='checkbox' value='" + n + "'></div><div style='float:left;margin-left:3px'>" + n + "</div><div style='clear:both'></div></div>").appendTo(jq_checks_select); 
								check_box = check_div.children();
								check_box.click(function(e){ 
									//jq_check.attr("value",$(this).attr("value") );
									temp=""; 
									temKey="";
									$("input:checked").each(function(i){ 
										if(i==0){ 
											temp=$(this).attr("value"); 
											temKey=$(this).attr("id");
										}else{ 
											temp+="、"+$(this).attr("value"); 
											temKey+="、"+$(this).attr("id"); 
										} 
									});
									 
									 jq_check.attr("value",temp); 
									 jq_id.attr("value",temKey);
									e.stopPropagation(); 
								}); 
							}); 
						}else{ 
							jq_checks_select.toggle();
						} 
						e.stopPropagation(); 
					});
					$(document).click(function () { 
						jq_checks_select.hide(); 
					}); 
					
					//$(this).blur(function(){ 
					//jq_checks_select.css("visibility","hidden"); 
					//alert(); 
					//}); 
					} 
				});
			})(jQuery);
	    </script>
	<script language="javascript"> 
		$(document).ready(function(){ 
			
			var options = { 
				"11111": "第一个选择项", 
				"22222": "第二个选择项", 
				"33333": "第三个选择项", 
				"44444": "第四个选择项", 
				"55555": "第五个选择项", 
				"66666": "第六个选择项" 
			}; 
			
			$.ajax({
		      type: "POST",
		      url: "./findProblemList.html",
		      dataType : "json",
		      success: function(result){
		      	$("#test_div").checks_select(result.obj);
		      }
		   });
		   
		   //$("#test_div").checks_select(options);
		}); 
	</script> 
		<style> 
			.checks_div_select { 
				width: 220px; 
				background-color: #ffffff; 
				border: 2px solid #000; 
				//font-family: 'Verdana', '宋体'; 
				font-family:Arial,Helvetica,sans-serif;
				font-size: 14px; 
				position: fixed; 
				height:300px;
				overflow-y:scroll; 
				z-index:999;
			} 
			
			.input:checked+span{background:#f00;}
			.input:checked+span:after{content:" 我被选中了";}
		</style> 
		<script>
		$(function(){
			$("#form").validate({
					rules: {
						
					},
					errorElement: "div",
					errorPlacement: function(error, element) {
						error.appendTo($(element).parent());
						$(element).parent().addClass("has-error");
						$(error).addClass("help-block alert-danger");
					},
					success: function(label) {
						$(label).parent().removeClass("has-error");
						$(label).remove();
					}
				});
			});
			function save(){
			
				var kindId = $("#kindId").val();
				if(kindId ==""){
					alert("信息种类不能为空");
					return;
				}
				var reportedName = $("#reportedName").val();
				if(reportedName ==""){
					alert("被举报人不能为空");
					return;
				}
				var reportedLevel = $("#reportedLevel").val();
				if(reportedLevel ==""){
					alert("级别不能为空");
					return;
				}
				var reportedUnit = $("#reportedUnit").val();
				if(reportedUnit ==""){
					alert("被举报单位不能为空");
					return;
				}
				var reportedPost = $("#reportedPost").val();
				if(reportedPost ==""){
					alert("被举报人职位不能为空");
					return;
				}
				var reportedZzmm = $("#reportedZzmm").val();
				if(reportedZzmm ==""){
					alert("政治面貌不能为空");
					return;
				}
				var problemNo = $("#checks_seelect_id").val();
				if(problemNo !=""){
					var tempArray  = problemNo.split("、"); //字符分割 
					if(tempArray.length > 3){
						alert("问题性质最多可选择三项");
						return;
					}
				}else{
					alert("请选择问题性质");
					return;
				}
				var reportedRegion = $("#reportedRegion").val();
				if(reportedRegion ==""){
					alert("地区不能为空");
					return;
				}
				var mainContent = $("#mainContent").val();
				if(mainContent ==""){
					alert("内容不能为空");
					return;
				}
				
				var formParam = $("#form").serialize();//序列化表格内容为字符串 
				var captcha = $("#captcha").val();
				if(captcha==""){
					alert("请输入验证码");
					return;
				}	
				
				if($("#form").valid()){
					 $.ajax({
					      type: "POST",
					      url: "./Save.html",
					      data: formParam,
					      dataType : "json",
					      success: function(data){
					      	alert(data.msg);
					      	location.reload();
					      	parent.location.href = "./returnfankui.html";
					      }
					   });
				}
			}
			
			function reportedSexChange() {
				$("#reportedSex").val($("#reportedRtype option:selected").val());
		    }
		    function disSexChange(){
				$("#disSex").val($("#disRtype option:selected").val());
		    }
		    //种类选择
		    function changeKind(value) {
		    
		    	$("#kindId").val(value);
		    }
		    //举报人级别选择
		    function changePost(value) {
		   	 $("#reportedLevel").val(value);
		    }
		    //政治面貌
		    function zzmm(value) {
		   	 $("#reportedZzmm").val(value);
		    }
		    
		 function chengyzm(){
			var img = document.getElementById('captchaImg');
			img.src = "${_b?html}/web/captcha.jpg?" + Math.random();
		 } 
</script>
<style>
	fieldset > legend {
	    border-bottom: 0 none;
	    font-size: 14px;
	    font-weight: bolder;
	    margin: 0 0 0 -5px;
	    padding: 0 5px;
	    width: auto;
	}
	fieldset {
	    border: 1px solid #e5e5e5;
	    margin-bottom: 10px;
	    padding: 10px 10px 0px;
	}
</style>
	</head>
	<body style="padding:5px;">
		<div class="panel panel-primary">
			<div class="panel-body" style="padding:5px;padding-top:15px;">
			
			
			<form id="form" class="form-horizontal" role="form" method='post' action="./Save.html">
			<input type="hidden" id="discloseId" name="discloseId" value="${ discloseId?html }"/>
			<input type='hidden'  name="reportedSex"  id='reportedSex' value='0' class='form-control' />
			<input type='hidden'  name="disSex"  id='disSex' value='0' class='form-control' />	
			<input type='hidden'  name="kindId"  id='kindId' value='${ formData.kindId!''?html }' class='form-control' />
			<input type='hidden'  name="mxcode"  id='mxcode' value='${ formData.mxcode!''?html }' class='form-control' />	
			<input type='hidden'  name="discloseType"  id='discloseType' value='0' class='form-control' />
			<fieldset>
				<legend><i class="icon icon-file-text-o"></i> 举报人信息</legend>
					<div class="">
							<table class="table table-bordered table-condensed">
								<tr style="">
						    		<th width="100" style="text-align:center;background-color:#eee;" >举报人姓名</th>
						    		<td ><input type='text'  name="disName"  id='disName' value='${ formData.disName!''?html }' class='form-control' /></td>
						    		<th width="80" style="text-align:center;background-color:#eee;" >身份证号</th>
						    		<td ><input type='text'  name="identityCard"  id='identityCard' value='${ formData.identityCard!''?html }' class='form-control' /></td>
						    		<th width="80" style="text-align:center;background-color:#eee;" >举报人性别</th>
						    		<td >
						    		<select id="disRtype" name="disRtype" class="form-control" style="width:97%;height:30px;"
			                                onchange="disSexChange();"> 
		                                <#assign disSex = 0>
		                                <#if formData.disSex?exists>
				             				<#assign disSex = (formData.disSex!'')/>
				             			</#if>
			                            <option  value="0" <#if disSex == 0>selected</#if>>女</option>
          								<option value="1" <#if  disSex == 1>selected</#if>>男</option>
			                        </select> 
			                        
						    		</td>
						  		</tr>
						  		<tr style="">
						    		<th width="100" style="text-align:center;background-color:#eee;" >所在单位</th>
						    		<td colspan="3"><input type='text'  name="disUnit"  id='disUnit' value='${ formData.disUnit!''?html }' class='form-control' /></td>
						    		<th  style="text-align:center;background-color:#eee;" >职务</th>
						    		<td ><input type='text'  name="disPost"  id='disPost' value='${ formData.disPost!''?html }' class='form-control' /></td>
						    		
						  		</tr>
						  		<tr style="">
						    		<th width="100" style="text-align:center;background-color:#eee;" >所在地区</th>
						    		<td colspan="3"><input type='text'  name="disRegion"  id='disRegion' value='${ formData.disRegion!''?html }' class='form-control' /></td>
						    		<th style="text-align:center;background-color:#eee;" >邮政编码</th>
						    		<td ><input type='text'  name="zipCode"  id='zipCode' value='${ formData.zipCode!''?html }' class='form-control' /></td>
						  		</tr>
						  		<tr style="">
						    		<th width="100" style="text-align:center;background-color:#eee;" >联系电话</th>
						    		<td ><input type='text'  name="phone"  id='phone' value='${ formData.phone!''?html }' class='form-control' /></td>
						    		<th  style="text-align:center;background-color:#eee;" >手机</th>
						    		<td ><input type='text'  name="telephone"  id='telephone' value='${formData.telephone!''?html }' class='form-control' /></td>
						    		<th style="text-align:center;background-color:#eee;" >Email</th>
						    		<td ><input type='text'  name="email"  id='email' value='${ formData.email!''?html }' class='form-control' /></td>
						    		
						  		</tr>
						  		<tr style="">
						    		<th width="100" style="text-align:center;background-color:#eee;" >联系地址</th>
						    		<td colspan="5"><input type='text'  name="address"  id='address' value='${ formData.address!''?html }' class='form-control' /></td>
						  		</tr>
							</table>
						</div>	
				</fieldset>
				<fieldset>
				<legend><i class="icon icon-file-text-o"></i> 被举报人信息</legend>
					<div class="">
							<table class="table table-bordered table-condensed">
								
						  		<tr style="">
						  			<th width="100" style="text-align:center;background-color:#eee;" >举报信息来源</th>
						    		<td ><input type='text'  name="mxname"  id='mxname' readOnly value='${ formData.mxname!''?html }' class='form-control' /></td>
						    		<th width="100" style="text-align:center;background-color:#eee;" >信息种类</th>
						    		<td colspan="3">
						    		<input type='hidden'  name="kindName"  id='kindName' value='${ formData.kindName!''?html }' class='form-control' />
							    		<select class="form-control" name="kind" id="kind" placeholder=""  style="width:98%" onchange="changeKind(this.value);">
						   					
						   					 <#assign kindId = "${kindId!''?html}">
						   					 <#if kindId?exists && kindId == ''>
						   						 <option value="" ></option>
						   					 </#if>
						   					<#list reportKindList as x>
						   						<option value="${x.kindId}" <#if x.kindId == kindId>selected</#if>>${x.kindName?html}</option>
						   					</#list>
						   				</select>
						    		</td>
						    								    		
						  		</tr>
						  		<tr style="">
						    		<th width="100" style="text-align:center;background-color:#eee;" >被举报人姓名</th>
						    		<td ><input type='text'  name="reportedName"  id='reportedName' value='${ formData.reportedName!''?html }' class='form-control' /></td>
									<th  style="text-align:center;background-color:#eee;" >级别</th>
						    		<td >
						    			<input type='hidden'  name="reportedLevel"  id='reportedLevel' value='${ formData.reportedLevel!''?html }' class='form-control' />
						    			<select class="form-control" name="level" id="kind" placeholder=""  style="width:98%" onchange="changePost(this.value);">
						   					<option value="" ></option>
						   					 <#assign levle = "">
			                                <#if formData?exists>
					             				<#assign levle = (formData.reportedLevel!'')/>
					             			</#if>
						   					<#list postList as x>
						   						<option value="${x.postId}" <#if x.postId == levle>selected</#if> >${x.postName?html}</option>
						   					</#list>
						   				</select>
						    		</td>
						    		
						    		
						    		<th width="80" style="text-align:center;background-color:#eee;" >性别</th>
						    		<td width="160">
						    		<select id="reportedRtype" name="reportedRtype" class="form-control" style="width:96%;height:30px;"
			                                onchange="reportedSexChange();"> 
			                                <#assign x = 0>
			                                <#if formData.reportedSex?exists>
					             				<#assign x = (formData.reportedSex!'')/>
					             			</#if>
			                            <option  value="0" <#if x == 0>selected</#if>>女</option>
          								<option value="1" <#if x == 1>selected</#if>>男</option>
			                        </select> 
						    		</td>
						  		</tr>
						  		<tr style="">
						  			<th width="100" style="text-align:center;background-color:#eee;" >职务</th>
						    		<td ><input type='text'  name="reportedPost"  id='reportedPost' value='${ formData.reportedPost!''?html }' class='form-control' /></td>
						  		
						    		<th width="100" style="text-align:center;background-color:#eee;" >所在单位</th>
						    		<td colspan="3"><input type='text'  name="reportedUnit"  id='reportedUnit' value='${ formData.reportedUnit!''?html }' style="width:98%;height:30px;" class='form-control' /></td>
						    								    		<#-- 
						    		<th width="100" style="text-align:center;background-color:#eee;" >政治面貌</th>
						    		<td >
										<select id="reported" name="reported" class="form-control" style="width:97%;height:30px;"
			                                onchange="zzmm(this.value);"> 
			                                 <option value="" ></option>
			                            <option value="中共共产党员" >中共共产党员</option>
          								<option value="群众" >群众</option>
          								<option value="其他" >其他</option>
			                        </select> 
						    			<input type='hidden'  name="reportedZzmm"  id='reportedZzmm' value='${ formData.reportedZzmm!''?html }' class='form-control' />
						    		</td>
						    		-->
						    	</tr>
						    	<tr style="">
						    		<th width="100" style="text-align:center;background-color:#eee;" >问题性质</th>
						    		<td colspan="5">
						    			<input type='hidden' id='checks_seelect_id' name="problemNo"  value='${ formData.problemNo!''?html }' readOnly class='form-control' />
						    			<input type='text' id = "test_div"  name="problemName" value='${ formData.problemName!''?html }'  readOnly class='form-control' />
						    		</td>
						  		</tr>
						  		<tr style="">
						    		<th width="100" style="text-align:center;background-color:#eee;" >所在地区</th>
						    		<td colspan="5"><input type='text'  name="reportedRegion"  id='reportedRegion' value='${ formData.reportedRegion!''?html }' class='form-control' /></td>
						  		</tr>
						  		<tr style="">
						    		<th width="100" style="text-align:center;background-color:#eee;" >主要问题</th>
						    		<td colspan="5">
						    			<textarea id="mainContent" name="mainContent" type="text/plain" style="width:100%;height:200px;">${formData.mainContent!''?html}</textarea>
						    		</td>
						  		</tr>
						  		<tr style="">
						    		<th width="100" style="text-align:center;background-color:#eee;" >验&nbsp;证&nbsp;码</th>
						    		<td colspan="6">
						    			<div class="input-group" style="width:250px">
											<span class="input-group-addon" >
							  					<i class="icon icon-unlock-alt" style="display:block;width:15px;"></i>
							  				</span>
											<input class="form-control " type="text" id="captcha" name="captcha" value="" placeholder="请输入验证码"/>
											<span class="input-group-addon" style="padding:0px 10px;border-left:0px;">
											<img id="captchaImg" onclick="chengyzm()" alt="验证码" onclick="chengyzm(this)" src="${_b?html}/web/captcha.jpg" style="vertical-align:middle;border-radius:4px;width:80px;cursor:pointer;">
											</span>
										</div>
						    		</td>
						  		</tr>
							</table>
						</div>	
				</fieldset>
				
				<div style="margin-top:5px;padding:5px;text-align:center;">
					<button class="btn btn-primary" type="button" onclick="save();"><i class="icon icon-save"></i> 保存</button>
					<button class="btn" type="button" onclick="history.go(-1);"><i class="icon icon-reply"></i> 返回</button>
				</div>
			</form>
		  	</div>
		</div>
	</body>
</html>